{% extends "base_generic.html" %}
{% block script %}
<script type="text/javascript">
  function generateUrl(name) {
    var sanitizedName = name;
    sanitizedName = sanitizedName.replace(/ el /gi, ' ');
    sanitizedName = sanitizedName.replace(/ la /gi, ' ');
    sanitizedName = sanitizedName.replace(/ los /gi, ' ');
    sanitizedName = sanitizedName.replace(/ las /gi, ' ');
    sanitizedName = sanitizedName.replace(/ de /gi, ' ');
    sanitizedName = sanitizedName.replace(/ del /gi, ' ');
    sanitizedName = sanitizedName.replace(/ temporada /gi, ' ');
    sanitizedName = string_to_slug(sanitizedName);
    sanitizedName = sanitizedName.replace(/--/gi, '-');
    sanitizedName = sanitizedName.replace(/---/gi, '-');
    sanitizedName = sanitizedName.replace(/----/gi, '-');
    $("#slug").val(sanitizedName);
  }
  $(window).load(
    function() {
      $(':input:visible:enabled:first').focus();
    });
</script>
{% endblock %}
{% block content %}
        <h1>Equipo</h1>
        <form action="/admin/countries/{{ key }}/save/" method="post">
        
        <div class="line">
          <div class="field">
            <label>Name:</label>
            <input id="name" name="name" type="text" size="65" value="{{ name }}" onblur="generateUrl(this.value);" />
          </div>
        </div>
        <div class="line">
          <div class="field">
            <label>Slug:</label>
            <input id="slug" name="slug" type="text" size="50" value="{{ slug }}" />
          </div>
          <div class="field">
            <label>Code:</label>
            <input id="code" name="code" type="text" size="20" value="{{ code }}" />
          </div>
           <div class="field">
             <label>Confederation:</label>
             <select name="confederation" id="confederation">
              <option value="UEFA">UEFA</option>
              <option value="CONMEBOL">CONMEBOL</option>
              <option value="CAF">CAF</option>
              <option value="AFC">AFC</option>
              <option value="OFC">OFC</option>
              <option value="CONCACAF">CONCACAF</option>
             </select>
           </div>
          </div>
        <input type="hidden" name="codenum" id="codenum" value="{{ filekey }}" />
        <input type="submit" value="Guardar" id="save" name="save" name="save" /><br class="clear" />
      </form>
      <br class="clear" />

{% endblock %}
      